import java.util.function.Predicate;

/**
 * @ClassName Demo07
 * @Description TODO
 * @Author Li
 * @Date 2022/8/14 15:12
 * @ModifyDate 2022/8/14 15:12
 * @Version 1.0
 */
public class Demo07 {
    private static void method(Predicate<String> pre1, Predicate<String> pre2) {
        boolean test = pre1.and(pre2).test("HelloWorld");
        System.out.println("该字符串是否满足要求：" + test);
    }

    public static void main(String[] args) {
        method(s -> {
            return s.contains("H");
        }, s -> {
            return s.contains("W");
        });
    }
}
